/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Service.Utilities
*        文件名:             ServiceManager.cs
*        创建系统时间:       2012/11/2 19:07:01
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Service.Utilities
{
    using ECP.Interface;
    using ECP.Utilities;

    public partial class ServiceManager : AbstractServiceFactory
    {
        private static ServiceManager instance = null;
        private static object locker = new object();
        private IServiceFactory serviceFactory;
        private static readonly string serviceFactoryClass = BaseConfiguration.Instance.ServiceFactory;
        private static readonly string servicePath = BaseConfiguration.Instance.ServicePath;

        public ServiceManager()
        {
            this.serviceFactory = base.GetServiceFactory(servicePath, serviceFactoryClass);
        }

        public IBusinessCardService BusinessCardService
        {
            get
            {
                return this.serviceFactory.CreateBusinessCardService();
            }
        }

        public IExceptionService ExceptionService
        {
            get
            {
                return this.serviceFactory.CreateExceptionService();
            }
        }

        public IFileService FileService
        {
            get
            {
                return this.serviceFactory.CreateFileService();
            }
        }

        public IFolderService FolderService
        {
            get
            {
                return this.serviceFactory.CreateFolderService();
            }
        }

        public static ServiceManager Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (locker)
                    {
                        if (instance == null)
                        {
                            instance = new ServiceManager();
                        }
                    }
                }
                return instance;
            }
        }

        public IItemDetailsService ItemDetailsService
        {
            get
            {
                return this.serviceFactory.CreateItemDetailsService();
            }
        }

        public IItemsService ItemsService
        {
            get
            {
                return this.serviceFactory.CreateItemsService();
            }
        }

        public ILoginService LoginService
        {
            get
            {
                return this.serviceFactory.CreateLoginService();
            }
        }

        public ILogService LogService
        {
            get
            {
                return this.serviceFactory.CreateLogService();
            }
        }

        public IMessageService MessageService
        {
            get
            {
                return this.serviceFactory.CreateMessageService();
            }
        }

        public IModuleService ModuleService
        {
            get
            {
                return this.serviceFactory.CreateModuleService();
            }
        }

        public IOrganizeService OrganizeService
        {
            get
            {
                return this.serviceFactory.CreateOrganizeService();
            }
        }

        public IParameterService ParameterService
        {
            get
            {
                return this.serviceFactory.CreateParameterService();
            }
        }

        public IPermissionAdminService PermissionAdminService
        {
            get
            {
                return this.serviceFactory.CreatePermissionAdminService();
            }
        }

        public IPermissionService PermissionService
        {
            get
            {
                return this.serviceFactory.CreatePermissionService();
            }
        }

        public IRoleService RoleService
        {
            get
            {
                return this.serviceFactory.CreateRoleService();
            }
        }

        public ISequenceService SequenceService
        {
            get
            {
                return this.serviceFactory.CreateSequenceService();
            }
        }

        public IStaffService StaffService
        {
            get
            {
                return this.serviceFactory.CreateStaffService();
            }
        }

        public IUserService UserService
        {
            get
            {
                return this.serviceFactory.CreateUserService();
            }
        }
    }
}